Skip to content

feat(picker): group themes by family, add search, swatches and a sample - #2

Merged
allisonhere merged 2 commits into
mainfrom
feat/grouped-theme-picker
Oct 28, 2026
Merged

allisonhere merged 2 commits into
mainfrom
feat/grouped-theme-picker

Conversation

@allisonhere

Copy link
Copy Markdown
Owner

What

ThemePicker.SoftModal becomes the full Tide-family theme picker that TideMail and Tide each carried a private copy of:

  • themes grouped under their family, the confirmed theme marked ●
  • a palette swatch beside each variant (ThemeSwatch, exported)
  • a sample of the highlighted theme: selected row, text, link, quote, status and tag colors
  • / search matching family, variant, name or light/dark; up/down step through the matches only, and enter will not confirm a theme the filter hides
  • the list scrolls to keep the cursor in view; pass the modal's whole height, and the sample is dropped when there is no room

New API: Filter(), Filtering(), ThemeSwatch(), and ThemePickerOptions.HideSwatch for a placeholder whose colors are only known at runtime (e.g. match-omarchy).

Compatibility

  • The plain Modal keeps its flat layout (no search line unless a filter is active) and all existing tests pass unchanged.
  • Themes with no Family are listed on their own rather than under a "System" header.
  • A short list sizes to its content instead of padding to the full height; a long list keeps its height while a filter narrows it.
  • Key handling is the library's (j/k/arrows/enter/esc, /). Apps with configurable bindings translate theirs before calling Update.

Testing

go test -race ./..., go vet ./... and a Windows vet pass. New tests cover grouping, filtering, navigation within a filter, enter on a hidden theme, reopen clearing the search, rendering, height fit and scrolling, HideSwatch, and the legacy modal's filter.

Once merged, TideMail and Tide can delete their copies of theme_picker.go.

allisonhere and others added 2 commits October 28, 2026 09:24
SoftModal now lists themes under their family with a palette swatch beside each
variant, marks the confirmed theme, and shows a sample of the highlighted
theme's colors. "/" starts a search that matches family, variant, name or
light/dark; navigation then steps through the matches only, and enter will not
confirm a theme the filter hides.

Themes with no family are listed on their own. HideSwatch lets an application
list a runtime-resolved placeholder without a swatch, and ThemeSwatch is
exported. The plain Modal keeps its flat layout but honours the search.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Brings the collection to 51 themes in 23 families. A saved "shades-of-purple"
now resolves to the default theme, like any unknown name.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@allisonhere
allisonhere merged commit 84bd8df into main Oct 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant